package mx.com.initzero.ecommerce.dao.impl;

import java.util.List;





import javax.sql.DataSource;

import mx.com.initzero.ecommerce.dao.ProductoDao;
import mx.com.initzero.ecommerce.dto.Producto;




import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class ProductoDaoImpl extends JdbcDaoSupport  implements ProductoDao {


	
	@Autowired
	public ProductoDaoImpl(DataSource dataSource) {
	
		setDataSource(dataSource);
	}
	
	@Override
	public void insertProducto(Producto producto) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<Producto> selectAll() {
		// TODO Auto-generated method stub
		return getJdbcTemplate().query("select * from producto",
				ParameterizedBeanPropertyRowMapper.newInstance(Producto.class));
		
	}

	@Override
	public List selectProductoByNombre(String producto) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Producto> selectProducto(String nombre) {
		// TODO Auto-generated method stub
		return null;
	}


}
